import cv2 as cv


def img_threshold():
    img = cv.imread('lena.png')
    gray_img = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
    ret, dst = cv.threshold(gray_img, 100, 255, cv.THRESH_BINARY)
    cv.namedWindow('dst_image')
    cv.namedWindow('src_image')
    cv.imshow('src_image', img)
    cv.imshow('dst_image', dst)
    cv.waitKey(0)
    cv.destroyAllWindows()


if __name__ == '__main__':
    img_threshold()
